package com.code.springbootwebsocket.controller.v1;

import com.code.springbootwebsocket.model.InMessage;
import com.code.springbootwebsocket.model.OutMessage;
import org.springframework.messaging.handler.annotation.MessageMapping;
import org.springframework.messaging.handler.annotation.SendTo;
import org.springframework.stereotype.Controller;

/**
 * @author: liyufei
 * @date: 2019-02-16 18:23
 */
@Controller
public class GameInfoController {

    @MessageMapping("/v1/chat")
    @SendTo("/topic/game_chat")
    public OutMessage gameInfo(InMessage message) {
        System.out.println("GameInfoController...");
        return OutMessage.builder().content(message.getContent()).build();
    }
}
